import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/gloable.css'
import request from "@/utils/request";

// main.js全局注册
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'

import './icons'; //icon



// 分页组件
import Pagination from "@/components/Pagination";

import { download } from '@/utils/request'
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/tool";
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree

import Router from 'vue-router'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
import {Notifacation}  from 'element-ui'
Vue.prototype.$notify = Notifacation
// use
Vue.use(mavonEditor)

Vue.config.productionTip = false

Vue.use(ElementUI, { size: "mini" });
Vue.component('Pagination', Pagination)

Vue.prototype.request=request

import scrollBar from '@/components/scrollBar';
import '@/components/scrollBar/index.less';
Vue.component('scroll-bar', scrollBar);
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
